package com.haizhi.bean;

// Generated 2016-8-15 17:44:37 by Hibernate Tools 3.2.2.GA

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Entity: 
 */
@Entity
@Table(name = "tb_product", catalog = "db_lemon3d")
public class TbProduct implements java.io.Serializable {

	/** 
	 * ��Ʒid.
	 */

	private Integer productId;

	/** 
	 * ����id.
	 */

	private TbUser tbUser;

	/** 
	 * ����Ʒid��fork������Ʒʱ�Ų�����.
	 */

	private TbProduct tbProduct;

	/** 
	 * ��Ʒ��ţ���ͬ�汾��Ʒ��Ʒ�����ͬ.
	 */

	private String productNum;

	/** 
	 * ��Ʒ��.
	 */

	private String productTitle;

	/** 
	 * ��Ʒ����.
	 */

	private String productDetails;

	/** 
	 * ����ͼƬ��ַ.
	 */

	private String productImgUrl;

	/** 
	 * PDF�ĵ���ַ.
	 */

	private String productPdfFileUrl;

	/** 
	 * ��Ʒ���ʱ��.
	 */

	private Date productAddTime;

	/** 
	 * ��Ʒ�޸�ʱ��.
	 */

	private Date productEditTime;

	/** 
	 * ��Ʒ״̬��-1:�ݸ壬0:˽�ˣ�1:������2:����.
	 */

	private int productStatus;

	/** 
	 * ���ղ���.
	 */

	private int productStartNum;

	/** 
	 * ��֧��.
	 */

	private int productForkNum;

	/** 
	 * �������۲������������ۣ�.
	 */

	private int productCommentNum;

	/** 
	 * ����������.
	 */

	private int product3dCommentNum;

	/** 
	 * ������Ʒ��Ĭ��Ϊ0��1Ϊ����.
	 */

	private int productIsExcellent;

	/** 
	 * vr״̬���ݶ�0Ϊ�ޣ�1Ϊ��.
	 */

	private int productIsVrModel;

	private Set<TbUserCollection> tbUserCollections = new HashSet<TbUserCollection>(
			0);

	private Set<TbComment> tbComments = new HashSet<TbComment>(0);

	private Set<TbProductData> tbProductDatas = new HashSet<TbProductData>(0);

	private Set<TbProduct> tbProducts = new HashSet<TbProduct>(0);

	private Set<TbVr> tbVrs = new HashSet<TbVr>(0);

	private Set<TbVr> tbVrs_1 = new HashSet<TbVr>(0);

	public TbProduct() {
	}

	public TbProduct(TbUser tbUser, String productNum, String productTitle,
			String productDetails, Date productAddTime, Date productEditTime,
			int productStatus, int productStartNum, int productForkNum,
			int productCommentNum, int product3dCommentNum,
			int productIsExcellent, int productIsVrModel) {
		setTbUser(tbUser);
		setProductNum(productNum);
		setProductTitle(productTitle);
		setProductDetails(productDetails);
		setProductAddTime(productAddTime);
		setProductEditTime(productEditTime);
		setProductStatus(productStatus);
		setProductStartNum(productStartNum);
		setProductForkNum(productForkNum);
		setProductCommentNum(productCommentNum);
		setProduct3dCommentNum(product3dCommentNum);
		setProductIsExcellent(productIsExcellent);
		setProductIsVrModel(productIsVrModel);
	}

	public TbProduct(TbUser tbUser, TbProduct tbProduct, String productNum,
			String productTitle, String productDetails, String productImgUrl,
			String productPdfFileUrl, Date productAddTime,
			Date productEditTime, int productStatus, int productStartNum,
			int productForkNum, int productCommentNum, int product3dCommentNum,
			int productIsExcellent, int productIsVrModel,
			Set<TbUserCollection> tbUserCollections, Set<TbComment> tbComments,
			Set<TbProductData> tbProductDatas, Set<TbProduct> tbProducts,
			Set<TbVr> tbVrs, Set<TbVr> tbVrs_1) {
		setTbUser(tbUser);
		setTbProduct(tbProduct);
		setProductNum(productNum);
		setProductTitle(productTitle);
		setProductDetails(productDetails);
		setProductImgUrl(productImgUrl);
		setProductPdfFileUrl(productPdfFileUrl);
		setProductAddTime(productAddTime);
		setProductEditTime(productEditTime);
		setProductStatus(productStatus);
		setProductStartNum(productStartNum);
		setProductForkNum(productForkNum);
		setProductCommentNum(productCommentNum);
		setProduct3dCommentNum(product3dCommentNum);
		setProductIsExcellent(productIsExcellent);
		setProductIsVrModel(productIsVrModel);
		setTbUserCollections(tbUserCollections);
		setTbComments(tbComments);
		setTbProductDatas(tbProductDatas);
		setTbProducts(tbProducts);
		setTbVrs(tbVrs);
		setTbVrs_1(tbVrs_1);
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "product_id", unique = true, nullable = false)
	public Integer getProductId() {
		return this.productId;
	}

	public void setProductId(Integer productId) {
		this.productId = productId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "user_id", nullable = false)
	public TbUser getTbUser() {
		return this.tbUser;
	}

	public void setTbUser(TbUser tbUser) {
		this.tbUser = tbUser;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "product_parent_id")
	public TbProduct getTbProduct() {
		return this.tbProduct;
	}

	public void setTbProduct(TbProduct tbProduct) {
		this.tbProduct = tbProduct;
	}

	@Column(name = "product_num", nullable = false)
	public String getProductNum() {
		return this.productNum;
	}

	public void setProductNum(String productNum) {
		this.productNum = productNum;
	}

	@Column(name = "product_title", nullable = false, length = 50)
	public String getProductTitle() {
		return this.productTitle;
	}

	public void setProductTitle(String productTitle) {
		this.productTitle = productTitle;
	}

	@Column(name = "product_details", nullable = false, length = 50)
	public String getProductDetails() {
		return this.productDetails;
	}

	public void setProductDetails(String productDetails) {
		this.productDetails = productDetails;
	}

	@Column(name = "product_img_url", length = 300)
	public String getProductImgUrl() {
		return this.productImgUrl;
	}

	public void setProductImgUrl(String productImgUrl) {
		this.productImgUrl = productImgUrl;
	}

	@Column(name = "product_pdf_file_url", length = 300)
	public String getProductPdfFileUrl() {
		return this.productPdfFileUrl;
	}

	public void setProductPdfFileUrl(String productPdfFileUrl) {
		this.productPdfFileUrl = productPdfFileUrl;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "product_add_time", nullable = false, length = 19)
	public Date getProductAddTime() {
		return this.productAddTime;
	}

	public void setProductAddTime(Date productAddTime) {
		this.productAddTime = productAddTime;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "product_edit_time", nullable = false, length = 19)
	public Date getProductEditTime() {
		return this.productEditTime;
	}

	public void setProductEditTime(Date productEditTime) {
		this.productEditTime = productEditTime;
	}

	@Column(name = "product_status", nullable = false)
	public int getProductStatus() {
		return this.productStatus;
	}

	public void setProductStatus(int productStatus) {
		this.productStatus = productStatus;
	}

	@Column(name = "product_start_num", nullable = false)
	public int getProductStartNum() {
		return this.productStartNum;
	}

	public void setProductStartNum(int productStartNum) {
		this.productStartNum = productStartNum;
	}

	@Column(name = "product_fork_num", nullable = false)
	public int getProductForkNum() {
		return this.productForkNum;
	}

	public void setProductForkNum(int productForkNum) {
		this.productForkNum = productForkNum;
	}

	@Column(name = "product_comment_num", nullable = false)
	public int getProductCommentNum() {
		return this.productCommentNum;
	}

	public void setProductCommentNum(int productCommentNum) {
		this.productCommentNum = productCommentNum;
	}

	@Column(name = "product_3d_comment_num", nullable = false)
	public int getProduct3dCommentNum() {
		return this.product3dCommentNum;
	}

	public void setProduct3dCommentNum(int product3dCommentNum) {
		this.product3dCommentNum = product3dCommentNum;
	}

	@Column(name = "product_is_excellent", nullable = false)
	public int getProductIsExcellent() {
		return this.productIsExcellent;
	}

	public void setProductIsExcellent(int productIsExcellent) {
		this.productIsExcellent = productIsExcellent;
	}

	@Column(name = "product_is_vrModel", nullable = false)
	public int getProductIsVrModel() {
		return this.productIsVrModel;
	}

	public void setProductIsVrModel(int productIsVrModel) {
		this.productIsVrModel = productIsVrModel;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tbProduct")
	public Set<TbUserCollection> getTbUserCollections() {
		return this.tbUserCollections;
	}

	public void setTbUserCollections(Set<TbUserCollection> tbUserCollections) {
		this.tbUserCollections = tbUserCollections;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tbProduct")
	public Set<TbComment> getTbComments() {
		return this.tbComments;
	}

	public void setTbComments(Set<TbComment> tbComments) {
		this.tbComments = tbComments;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tbProduct")
	public Set<TbProductData> getTbProductDatas() {
		return this.tbProductDatas;
	}

	public void setTbProductDatas(Set<TbProductData> tbProductDatas) {
		this.tbProductDatas = tbProductDatas;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tbProduct")
	public Set<TbProduct> getTbProducts() {
		return this.tbProducts;
	}

	public void setTbProducts(Set<TbProduct> tbProducts) {
		this.tbProducts = tbProducts;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tbProduct")
	public Set<TbVr> getTbVrs() {
		return this.tbVrs;
	}

	public void setTbVrs(Set<TbVr> tbVrs) {
		this.tbVrs = tbVrs;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tbProduct")
	public Set<TbVr> getTbVrs_1() {
		return this.tbVrs_1;
	}

	public void setTbVrs_1(Set<TbVr> tbVrs_1) {
		this.tbVrs_1 = tbVrs_1;
	}

}
